package com.share51.novel.common;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * 输出response 工具类
 * @author gb
 */
public class ResponseUtil {

    public static void print(HttpServletResponse response,int status,Object obj) throws IOException {
        response.setStatus(status);
        response.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=utf-8");
        PrintWriter out = response.getWriter();
        out.print(obj);
        out.flush();
        out.close();
    }
}
